package com.wg.wuge.study.designmodel.openclosedesigndemo;

public class QpsAlertHandler extends AlertHandler{
    public QpsAlertHandler(AlertRule alertRule, Notification notification) {
        super(alertRule, notification);
    }

    @Override
    public void check(ApiStatInfo apiStatInfo) {
        long tps = apiStatInfo.getRequestCount()/apiStatInfo.getDurationOfSeconds();
        if (tps > 5) {
            notification.notifyIt();
        }
    }
}
